package progress

type SimpleSimpleProgress []string

var (
	SimpleColorValue SimpleSimpleProgress = []string{
		"\033[36m[/]\033[m",  //
		"\033[36m[-]\033[m",  //
		"\033[36m[\\]\033[m", //
		"\033[36m[|]\033[m",  //
	}
	SimpleSpinnerValue = []string{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}
)

type SimpleProgress struct {
	workType ProgressType
	step     int

	values []string
}

func NewSimpleProgress(values []string) *SimpleProgress {
	return &SimpleProgress{
		workType: OnlyValue,
		values:   values,
	}
}
func (p *SimpleProgress) Next() {
	p.step++
	if p.step >= len(p.values) {
		p.step = 0
	}
}

func (p *SimpleProgress) Value() string {
	return p.values[(p.step % len(p.values))]
}

func (p *SimpleProgress) NextValue() string {
	p.Next()
	return p.Value()
}
